# load the library and Create Reference to Library object 
require 'watir'
include Watir

# define variables
testURL = 'http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ComboBox/ComboBox.aspx'

puts 'tests execution started'
1.times do
  ie = Watir::IE.new
  ie.goto testURL
  ie.text_field(:id,"ctl00_SampleContent_ComboBox1_TextBox").set("Oscar")
  # AutoPostBack CheckBox: 
  ie.checkbox(:id,"ctl00_SampleContent_AutoPostBackCheckBox").set
  sleep (5)
  puts("AutoPostBack = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoPostBackSourceLabel").text + '"')
  ie.checkbox(:id,"ctl00_SampleContent_AutoPostBackCheckBox").clear
  sleep (5)
  puts("AutoPostBack = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoPostBackSourceLabel").text + '"')
  #  DropDownStyle RadioButton
  ie.radio(:id,"ctl00_SampleContent_DropDownStyleRadioButtonList_0").set
  sleep (5)
  puts("DropDownStyle = " + '"' + ie.text_field(:id,"ctl00_SampleContent_DropDownStyleSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_DropDownStyleRadioButtonList_1").set
  sleep (5)
  puts("DropDownStyle = " + '"' + ie.text_field(:id,"ctl00_SampleContent_DropDownStyleSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_DropDownStyleRadioButtonList_2").set
  sleep (5)
  puts("DropDownStyle = " + '"' + ie.text_field(:id,"ctl00_SampleContent_DropDownStyleSourceLabel").text + '"')
  #  AutoCompleteMode RadioButton
  ie.radio(:id,"ctl00_SampleContent_DropDownStyleRadioButtonList_0").set
  sleep (5)
  puts("AutoCompleteMode = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoCompleteModeSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_AutoCompleteModeRadioButtonList_1").set
  sleep (5)
  puts("AutoCompleteMode = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoCompleteModeSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_AutoCompleteModeRadioButtonList_2").set
  sleep (5)
  puts("AutoCompleteMode = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoCompleteModeSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_AutoCompleteModeRadioButtonList_3").set
  sleep (5)
  puts("AutoCompleteMode = " + '"' + ie.text_field(:id,"ctl00_SampleContent_AutoCompleteModeSourceLabel").text + '"')
  # CaseSensitive CheckBox 
  ie.checkbox(:id,"ctl00_SampleContent_CaseSensitiveCheckBox").set
  sleep (5)
  puts("CaseSensitive = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CaseSensitiveSourceLabel").text + '"')
  ie.checkbox(:id,"ctl00_SampleContent_CaseSensitiveCheckBox").clear
  sleep (5)
  puts("CaseSensitive = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CaseSensitiveSourceLabel").text + '"')
  # CssClassRadioButton
  ie.radio(:id,"ctl00_SampleContent_CssClassRadioButtonList_0").set
  sleep (5)
  puts("CssClass = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CssClassSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_CssClassRadioButtonList_1").set
  sleep (5)
  puts("CssClass = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CssClassSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_CssClassRadioButtonList_2").set
  sleep (5)
  puts("CssClass = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CssClassSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_CssClassRadioButtonList_3").set
  sleep (5)
  puts("CssClass = " + '"' + ie.text_field(:id,"ctl00_SampleContent_CssClassSourceLabel").text + '"')
  # ItemInsertLocation RadioButton
  ie.radio(:id,"ctl00_SampleContent_ItemInsertLocationRadioButtonList_0").set
  sleep (5)
  puts("ItemInsertLocation = " + '"' + ie.text_field(:id,"ctl00_SampleContent_ItemInsertLocationSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_ItemInsertLocationRadioButtonList_1").set
  sleep (5)
  puts("ItemInsertLocation = " + '"' + ie.text_field(:id,"ctl00_SampleContent_ItemInsertLocationSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_ItemInsertLocationRadioButtonList_2").set
  sleep (5)
  puts("ItemInsertLocation = " + '"' + ie.text_field(:id,"ctl00_SampleContent_ItemInsertLocationSourceLabel").text + '"')
  ie.radio(:id,"ctl00_SampleContent_ItemInsertLocationRadioButtonList_3").set
  sleep (5)
  puts("ItemInsertLocation = " + '"' + ie.text_field(:id,"ctl00_SampleContent_ItemInsertLocationSourceLabel").text + '"')
  ie.close
end
puts 'tests execution finished'